/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.applicatioN.entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Slim
 */
@Entity
@Table(name = "historique")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Historique.findAll", query = "SELECT h FROM Historique h"),
    @NamedQuery(name = "Historique.findByHistoId", query = "SELECT h FROM Historique h WHERE h.histoId = :histoId"),
    @NamedQuery(name = "Historique.findByAppreciation", query = "SELECT h FROM Historique h WHERE h.appreciation = :appreciation"),
    @NamedQuery(name = "Historique.findByDateDeDebut", query = "SELECT h FROM Historique h WHERE h.dateDeDebut = :dateDeDebut"),
    @NamedQuery(name = "Historique.findByDateDeFin", query = "SELECT h FROM Historique h WHERE h.dateDeFin = :dateDeFin"),
    @NamedQuery(name = "Historique.findByDernierSalaire", query = "SELECT h FROM Historique h WHERE h.dernierSalaire = :dernierSalaire")})
public class Historique implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "HISTO_ID")
    private Integer histoId;
    @Basic(optional = false)
    @Column(name = "APPRECIATION")
    private int appreciation;
    @Basic(optional = false)
    @Column(name = "DATE_DE_DEBUT")
    @Temporal(TemporalType.DATE)
    private Date dateDeDebut;
    @Basic(optional = false)
    @Column(name = "DATE_DE_FIN")
    @Temporal(TemporalType.DATE)
    private Date dateDeFin;
    @Basic(optional = false)
    @Column(name = "DERNIER_SALAIRE")
    private double dernierSalaire;
    @JoinColumn(name = "NOM_POSTE", referencedColumnName = "NOM_POSTE")
    @ManyToOne(optional = false)
    private Poste nomPoste;
    @JoinColumn(name = "IDENTIFIANT", referencedColumnName = "IDENTIFIANT")
    @ManyToOne(optional = false)
    private Candidat identifiant;

    public Historique() {
    }

    public Historique(Integer histoId) {
        this.histoId = histoId;
    }

    public Historique(Integer histoId, int appreciation, Date dateDeDebut, Date dateDeFin, double dernierSalaire) {
        this.histoId = histoId;
        this.appreciation = appreciation;
        this.dateDeDebut = dateDeDebut;
        this.dateDeFin = dateDeFin;
        this.dernierSalaire = dernierSalaire;
    }

    public Integer getHistoId() {
        return histoId;
    }

    public void setHistoId(Integer histoId) {
        this.histoId = histoId;
    }

    public int getAppreciation() {
        return appreciation;
    }

    public void setAppreciation(int appreciation) {
        this.appreciation = appreciation;
    }

    public Date getDateDeDebut() {
        return dateDeDebut;
    }

    public void setDateDeDebut(Date dateDeDebut) {
        this.dateDeDebut = dateDeDebut;
    }

    public Date getDateDeFin() {
        return dateDeFin;
    }

    public void setDateDeFin(Date dateDeFin) {
        this.dateDeFin = dateDeFin;
    }

    public double getDernierSalaire() {
        return dernierSalaire;
    }

    public void setDernierSalaire(double dernierSalaire) {
        this.dernierSalaire = dernierSalaire;
    }

    public Poste getNomPoste() {
        return nomPoste;
    }

    public void setNomPoste(Poste nomPoste) {
        this.nomPoste = nomPoste;
    }

    public Candidat getIdentifiant() {
        return identifiant;
    }

    public void setIdentifiant(Candidat identifiant) {
        this.identifiant = identifiant;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (histoId != null ? histoId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Historique)) {
            return false;
        }
        Historique other = (Historique) object;
        if ((this.histoId == null && other.histoId != null) || (this.histoId != null && !this.histoId.equals(other.histoId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.applicatioN.entities.Historique[ histoId=" + histoId + " ]";
    }
    
}
